package com.xunfang.shareaddress;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;

import com.xunfang.shareaddress.util.GpsConfigFile;

public class SetServiceAddress extends Activity {
private EditText service_address;
private Button sarcannel,sarok;
	
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		setContentView(R.layout.setserviceaddress);
		service_address=(EditText)findViewById(R.id.service_address);
		sarcannel=(Button)findViewById(R.id.sarcannel);
		sarok=(Button)findViewById(R.id.sarok);
		sarcannel.setOnClickListener(new OnButtonClick());
		sarok.setOnClickListener(new OnButtonClick());
	}
 class OnButtonClick implements OnClickListener{

	
	public void onClick(View v) {
		// TODO Auto-generated method stub
		if(v.getId()==R.id.sarok){
			if("".equals(service_address.getText().toString())){
				Toast.makeText(SetServiceAddress.this, "请输入服务器地址", 0).show();
			}else{
			GpsConfigFile.ServerAddress=service_address.getText().toString().trim();
			finish();
			}
		}
		if(v.getId()==R.id.sarcannel){
			finish();
		}
	}
	 
 }

}
